import java.util.Arrays;

/**
 * @author 陈艺菲
 * @date 2025/7/4 18:39
 * @description [这里简要描述类的功能]
 * 2025居比绝对上岸！
 */

class Animal{
    public int age;
    public String name;

    public void eat(){
        System.out.println("正在吃饭");
    }

        }

class Dog extends Animal{

    public Dog(String name,int age){
        this.name=name;
        this.age=age;
    }

    @Override
    public void eat() {
        System.out.println("正在吃狗粮");
    }
}

class Cat extends Animal {
    public Cat(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public void eat() {
        System.out.println("正在吃猫粮");
    }
}

public class JavaSE8 {

    public static void animalEat(Animal animal){
        animal.eat();

    }
    public static void main(String[] args) {
        Dog dog=new Dog("袋狗",25);
        Cat cat=new Cat("咪咪",1);
        animalEat(dog);
        animalEat(cat);


        
    }


}
